package com.feri.redromance01.controller;

import com.feri.redromance01.entity.Services;
import com.feri.redromance01.service.intf.ServicesService;
import com.feri.redromance01.vo.PageBean;
import com.feri.redromance01.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * //                                              __----~~~~~~~~~~~------___
 * //                                        .  .   ~~//====......          __--~ ~~
 * //                        -.            \_|//     |||\\  ~~~~~~::::... /~
 * //                     ___-==_       _-~o~  \/    |||  \\            _/~~-
 * //             __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
 * //         _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
 * //       .~       .~       |   \\ -_    /  /-   /   ||      \   /
 * //      /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
 * //      |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
 * //               '         ~-|      /|    |-~\~~       __--~~
 * //                           |-~~-_/ |    |   ~\_   _-~            /\
 * //                                /  \     \__   \/~                \__
 * //                            _--~ _/ | .-~~____--~-/                  ~~==.
 * //                           ((->/~   '.|||' -_|    ~~-/ ,              . _||
 * //                                      -_     ~\      ~~---l__i__i__i--~~_/
 * //                                      _-~-__   ~)  \--______________--~~
 * //                                   //.-~~~-~_--~- |-------~~~~~~~~
 * //                                           //.-~~~--\
 * <p>
 * zpy
 * 2022/8/28
 */
@RestController
@RequestMapping("/api/services/")
public class ServicesController {
    @Autowired
    private ServicesService services1;

    @PostMapping("save.do")
    public R save(Services services) {
        return services1.save(services);
    }
    //删除
    @GetMapping("del.do")
    public R del(int ser_id){
        return services1.delete(ser_id);
    }
    //修改
    @PostMapping("update.do")
    public R update(Services services){
        return services1.update(services);
    }
    //查询
    @GetMapping("page.do")
    public PageBean page(String ser_name, int page, int limit){
        return services1.selectPage(ser_name, page, limit);
    }
}

